<?php
class View_User{
	
	/**
	 * Метод выводит сообщение пользователю, если такое имеется
	 *
	 * @param string $message - текст сообщения
	 * @param integer $messageType - тип сообщения
	 */
	public static function showUserMessage($message, $messageType) {
		if($messageType > 0)
			self::showSuccessMessage($message);
		if($messageType < 0)
			self::showErrorMessage($message);
	}
	
	/**
	 * Метод выводит сообщение пользователю об успехе
	 *
	 * @param string $message - текст сообщения
	 */
	public static function showSuccessMessage($message) {
		echo '<div class="userSuccess">' . $message . '</div>';
	}
	
	/**
	 * Метод выводит сообщение пользователю об ошибке
	 *
	 * @param string $message - текст сообщения
	 */
	public static function showErrorMessage($message) {
		echo '<div class="userError"><b>Возникли следующие ошибки</b>:<br />' . $message . '</div>';
	}


	public static function showUsersList($arrUsers){
		
		echo '<span class="com_title">Пользователи <!--<ins class="online_c">Онлайн</ins>--></span>';
		
		echo '<ul class="us_com left">';

		$i = 1;
		foreach ($arrUsers as $arrUser){
			$id_user = $arrUser['id_user'];
			$fio = $arrUser['fio'];
			$isOnline = $arrUser['ts'] < 30 ? true : false;
			$class = $isOnline ? "online" : "offline";
			if ($i == 11 || $i == 21) echo "</ul><ul class='us_com left'>";

			echo '<li id="user_'.$id_user.'" class="users_list"><a title="Профиль" href="'.W_ABSPATH.'profile/'.$id_user.'" class="'.$class.'">'.$fio.'</a></li>';
			$i++;
		}
		echo '</ul>';

	}
	
	public static function getUsersGroupPopup($arrUsers){
		$size = sizeof($arrUsers);
		for ($i=0; $i<$size; $i++){
			echo '<div id="groups_user_'.$arrUsers[$i]["id_user"].'" style="display:none;" class="groups_user">';
			echo '	<table>';
			echo '	<tr>';
			echo '		<td>';
			echo '			<span><b>'.$arrUsers[$i]["fio"].'</b></span>';
			echo '		</td>';
			echo '		<td></td>';
			echo '	</tr>';
			
			foreach ($arrUsers[$i]["groups"] as $group => $issetInGroup){
				
				echo '	<tr>';
				echo '		<td>';
				echo '<label for="for_label_'.$arrUsers[$i]["id_user"].'_'.$group.'"><span style="padding: 5px 5px 0 5px;">'.$group.'</span></label>';
				echo '		</td>';
				echo '		<td style="padding: 5px 5px 0 5px;">';
				echo '<input type="checkbox" '.($issetInGroup ? 'checked="checked"' : '').' id="for_label_'.$arrUsers[$i]["id_user"].'_'.$group.'"
				onChange="Admin.pageSetUsersGroup.changeUserGroupStatus(this, '.$arrUsers[$i]["id_user"].', \''.$group.'\');"  />';
				echo '		</td>';
				echo '	</tr>';
				
			}
			
			echo '	</table>';
			echo '</div>';
		}
	}

	public static function showUsersSearchFilter(){
		echo '			
				<div class="content_search">
					<input type="text" class="search_c" value="Введите имя или фамилию" />
					<a href="#" class="sr_btn">Все</a>
					<a href="#" class="sr_btn">Онлайн</a>
					<a href="#" class="sr_btn">Оффлайн</a>
				</div><!-- .content_search -->
				<div class="company_filter">
					<span class="filter_title">Фильтр</span>
					<select class="filter_sel">
						<option>Выберите страну</option>
					</select>
					<select class="filter_sel">
						<option>Выберите регион</option>
					</select>
					<select class="filter_sel">
						<option>Выберите город</option>
					</select>
				</div><!-- .company_filter -->
';		
	}	
	

	
	/**
	 * Выводит список пользователей, ожидающих инвайт
	 *
	 * @param array $arrWaiters
	 * @return unknown
	 */
	public static function showListOfInviteWaiters($arrWaiters) {
		$waitersSize = sizeof($arrWaiters);
		if(!$waitersSize)
		  return false;
		echo '
		<form action="" method="POST" id="approveEmail">
		<table cellspacing=0 cellpadding=0>';
					echo '<tr style="padding-bottom:5px;">';
				echo '<th>№</th>
							<th>E-Mail&nbsp;</th>
							<th>Дата</th>';
			echo '</tr>';
		for ($i = 0; $i < $waitersSize; $i++) {

		  echo '<tr>';
		    echo '<td' . ($i % 2 != 0 ? ' class="odd"' : '') . ' style="padding:5px 15px 0 0;">' . ($i+1) . '</td>';
		    echo '<td' . ($i % 2 != 0 ? ' class="odd"' : '') . ' style="padding:5px 15px 0 0;">' . $arrWaiters[$i]['e_mail'] . '</td>';
		    echo '<td' . ($i % 2 != 0 ? ' class="odd"' : '') . ' style="padding:5px 15px 0 0;">' . ($arrWaiters[$i]['creation']) . '</td>';
		    echo '<td' . ($i % 2 != 0 ? ' class="odd"' : '') . ' style="padding:5px 0 0 0;"><input type="checkbox" name="approved[]" value="' . $arrWaiters[$i]['id_e_mail'] . '"></td>';
		  echo '</tr>';
		}
		echo '</table>
		<div class="collectionAction" style="margin: 15px 0 15px 0">
            <a href="#" onClick="return false;" title="" id="selectAll">Выделить все</a>, <a href="#" onClick="return false;" title="" id="selectNone">Снять выделение</a>
          </div>
          <input type="submit" style="margin: 0 15px 0 0" name="submitApproveEmail" value="Утвердить" />
          <input type="submit" style="margin: 0" name="submitDeleteEmail" value="Удалить" onClick="return confirm(\'Вы действительно хотите удалить?\')" />
          </form>';
	}

	public function getUserChatAvatar($idUser){
		if ($idUser == NULL) throw new Exception("Нет номера пользователя. ", E_USER_ERROR);
		
		$chat_avatar = IMAGES."avatars/chat_$idUser.jpg";
		if (!file_exists($chat_avatar)) $chat_avatar = W_IMAGES."avatars/chat_no_avatar.jpg";
		else $chat_avatar = W_IMAGES."avatars/chat_$idUser.jpg";
		
		return $chat_avatar;
	}
	
	public static function showUserFriendsLeftBlock($arrFriendsOnline, $arrFriendsOffline){
		echo '<div id="friends_left_block">';
		echo '	<span class="lf_title onl">Онлайн</span>';
		echo '	<ul class="online_pl">';
		
		// онлайн
		$onlines = sizeof($arrFriendsOnline);
		for ($i=0; $i<$onlines; $i++){
			$idFriend = $arrFriendsOnline[$i]['id_user'];
			$fioFriend = $arrFriendsOnline[$i]['fio'];
			$chatText = $arrFriendsOnline[$i]['newMessagesCount'] ? "&nbsp;(&nbsp;".$arrFriendsOnline[$i]['newMessagesCount']."&nbsp;)" : "";
		?>
					<li class="for_remove<?=$idFriend?>">
						<a href="<?=W_ABSPATH?>profile/<?=$idFriend?>" title="<?=$fioFriend?>"><?=$fioFriend?></a>
						<span><a href="javascript: void(0)" onClick="chat.openChatWith(<?=$idFriend?>)" class="chat_user_mess_counter" attrIdFriend="<?=$idFriend?>">чат<?=$chatText?></a></span>
					</li>
		<?
		}
		if ($onlines == 0) echo "нет пользователей.";
		
		echo '	</ul>';
		
		// оффлайн
		echo '	<span class="lf_title offl" id="lf_title">Оффлайн</span>';
		echo '	<ul class="offline_pl">';
		
		$offlines = sizeof($arrFriendsOffline);
		for ($i=0; $i<$offlines; $i++){
			$idFriend = $arrFriendsOffline[$i]['id_user'];
			$fioFriend = $arrFriendsOffline[$i]['fio'];
			$chatText = $arrFriendsOffline[$i]['newMessagesCount'] ? "&nbsp;(&nbsp;".$arrFriendsOffline[$i]['newMessagesCount']."&nbsp;)" : "";
			?>
					<li class="for_remove<?=$idFriend?>">
						<a href="<?=W_ABSPATH?>profile/<?=$idFriend?>" title="<?=$fioFriend?>"><?=$fioFriend?></a>
						<span><a href="javascript: void(0)" onClick="chat.openChatWith(<?=$idFriend?>)" class="chat_user_mess_counter" attrIdFriend="<?=$idFriend?>">чат<?=$chatText?></a></span>
					</li>
			<?
		}
		if ($offlines == 0) echo "нет пользователей.";
		
		echo '	</ul>';
		echo '</div> <!-- #friends_left_block-->';
		
		echo '<div class="clear"></div><!-- .clear-->';
		
	}
	
	
	
	///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	// custom for neftemagnat //
	
	/**
	 * Метод выводит профайл пользователя
	 * должна быть переменная - кем является user (manager)
	 *
	 * @param unknown_type $arrUser
	 */
	public static function showProfile($arrUser){
		
	}
	
	/**
	 * Метод выводит форму изменения данных пользователя
	 * 
	 */
        public static function showUserChangeRegDataForm(){
		$objUser = User_User::instance();
		$objUser->VB_userInit();
                ?>
          	<span class="reg_title">Изменение данных пользователя</span>
                
			<form action="<?=W_ABSPATH?>profile/edit" method="POST" enctype="multipart/form-data">
				<div class="wth_tdash mt20">
					<table>
						<tr>
							<td class="st_tb"><span>E-mail<sup>*</sup>:</span></td>
							<td><input type="text" class="reg_txt" name="email" value="<?=$objUser->arrUserInfo["email"]?>"/></td>
						</tr>
						<tr>
							<td class="st_tb"><span><?=/*/ Логин*/ _("Login")?><sup>*</sup>:</span></td>
							<td><input type="text" class="reg_txt" name="login" value="<?=$objUser->arrUserInfo["login"]?>" /></td>
						</tr>
						<tr>
							<td class="st_tb"><span><?=/*/ Пароль*/ _("Password")?><sup>*</sup>:</span></td>
							<td><input type="password" class="reg_txt" name="pass1" value=""/></td>
						</tr>
						<tr>
							<td class="st_tb"><span><?=/*/ Повторите пароль*/ _("Repeat password")?><sup>*</sup>:</span></td>
							<td><input type="password" class="reg_txt" name="pass2" /></td>
						</tr>
					</table>
				</div><!-- .wth_tdash -->

                                <div class="wth_tdash mt20">
					<table>
						<tr>
							<td class="st_tb"><span><?=/*/ Имя*/ _("First name")?><sup>*</sup>:</span></td>
							<td><input type="text" class="reg_txt" name="firstName" value="<?=$objUser->arrUserInfo["first_name"]?>"/></td>
						</tr>
						<tr>
							<td class="st_tb"><span><?=/*/ Фамилия*/ _("Last name")?><sup>*</sup>:</span></td>
							<td><input type="text" class="reg_txt" name="lastName" value="<?=$objUser->arrUserInfo["last_name"]?>"/></td>
						</tr>
						<tr>
							<td class="st_tb"><span><?=/*/ Дата рождения*/ _("Birthday")?>:</span></td>
							<td>
								<input style="width:35px;" type="text" placeholder="ДД" maxlength="2" name="birthDayDay" value="<?=$objUser->birthDay_day?>">
								<input style="width:35px;" type="text" placeholder="ММ" maxlength="2" name="birthDayMonth" value="<?=$objUser->birthDay_month?>">
								<select name="birthDayYear">
									<?=Service_Date::getOptionsForYearSelect(1950, $objUser->birthDay_year);?>
								</select>
							</td>
						</tr>
						<tr>
							<td class="st_tb"><span><?=/*/ Страна*/ _("Country")?>:</span></td>
							<td>
								<select name="country" id="country_select" style="width:150px;" onchange="regChangeCountry(this)">
									<?=Service_Country::getOptionsForCountrySelect(Service_Country::getAllCountry(), $objUser->arrUserInfo["id_country"])?>
								</select>
							</td>
						</tr>
						<tr>
							<td class="st_tb"><span><?=/*/ Город*/ _("City")?>:</span></td>
							<td>
								<select name="city" id="city_select" style="width:150px;">
									<?=Service_Country::getOptionsForCitySelect(Service_Country::getAllCity($objUser->arrUserInfo["id_country"]), $objUser->arrUserInfo["id_city"])?>
								</select>
							</td>
						</tr>												
						<tr>
							<td class="st_tb"><span><?=/*/ Пол*/ _("Sex")?>:</span></td>
							<td>
								<select name="sex">
									<option value="male" <?=($objUser->arrUserInfo["sex"] == 'male') ? 'selected="selected"' : ''?> ><?=/*/ мужской*/_("male")?></option>
									<option value="female" <?=($objUser->arrUserInfo["sex"] == 'female') ? 'selected="selected"' : ''?> ><?=/*/ женский*/_("female")?></option>
								</select>
							</td>
						</tr>
						<tr>
							<td class="st_tb"><span><?=/*/ Телефон*/ _("Phone")?>:</span></td>
							<td><input type="text" class="reg_txt" name="phone" value="<?=$objUser->arrUserInfo["phone"]?>" /></td>
						</tr>	
					</table>
				</div><!-- .wth_tdash -->
				
				<div class="wth_tdash mt20">
					<table>
						<tr>
							<td class="st_tb"><span><?=/*/ Профессия*/ _("Profession")?>:</span></td>
							<td><input type="text" class="reg_txt" name="profession" value="<?=$objUser->arrUserInfo["profession"]?>"/></td>
						</tr>
						<tr>
							<td class="st_tb"><span><?/*/ Опыт работы*/?> Опыт работы:</span></td>
							<td>
								<select name="professionExperience">
									<option value="1" <?=($objUser->arrUserInfo["profession_experience"] == 1 ? 'selected="selected"' : '')?>>1 год</option>
									<option value="2" <?=($objUser->arrUserInfo["profession_experience"] == 2 ? 'selected="selected"' : '')?>>2 года</option>
									<option value="3" <?=($objUser->arrUserInfo["profession_experience"] == 3 ? 'selected="selected"' : '')?>>3 года</option>
									<option value="4" <?=($objUser->arrUserInfo["profession_experience"] == 4 ? 'selected="selected"' : '')?>>4 года</option>
									<option value="5" <?=($objUser->arrUserInfo["profession_experience"] == 5 ? 'selected="selected"' : '')?>>5 лет</option>
									<option value="6" <?=($objUser->arrUserInfo["profession_experience"] == 6 ? 'selected="selected"' : '')?>>6 лет</option>
									<option value="7" <?=($objUser->arrUserInfo["profession_experience"] == 7 ? 'selected="selected"' : '')?>>7 лет</option>
									<option value="8" <?=($objUser->arrUserInfo["profession_experience"] == 8 ? 'selected="selected"' : '')?>>8 лет</option>
									<option value="9" <?=($objUser->arrUserInfo["profession_experience"] == 9 ? 'selected="selected"' : '')?>>9 лет</option>
									<option value="10" <?=($objUser->arrUserInfo["profession_experience"] == 10 ? 'selected="selected"' : '')?>>10 лет</option>
								</select>
							</td>
						</tr>
					</table>
				</div><!-- .wth_tdash -->
				
				<div class="wth_tdash mt20">
					<table>
						<tr>
							<td class="st_tb"><span>Капча:</span></td>
							<td><p><img src="<?=W_ABSPATH?>include/captcha/?<?=session_name()?>=<?=session_id()?>"></p></td>
						</tr>
						<tr>
							<td class="st_tb"><span>Введите текст с картинки<sup>*</sup>:</span></td>
							<td><input type="text" class="reg_txt" name="regKcapthca" size="16" value="<?//=$objUser->regKcapthca?>"/></td>
						</tr>
					</table>
				</div><!-- .wth_tdash -->				
				<div class="wth_tdash mt20">
					<table>

						<tr>
							<td class="st_tb">&nbsp;</td>
							<td>
							  <input type="submit" class="confirm" name="registration" value="Сохранить изменения" />
							</td>
						</tr>
					</table>
				</div><!-- .wth_tdash -->
			</form>
	                
                
                
                <?
        }
	
	/**
	 * Метод выводит форму регистрации пользователя
	 * 
	 */
	public static function showUserRegForm(){
		$objUser = User_User::instance();
		$objUser->VB_userInit();
		?>
		
			<span class="reg_title"><?='Регистрация нового пользователя'//Регистрация нового пользователя?></span>
			<p>
			<? /// Прежде чем зарегистрироваться, прочитайте наши Правила
				printf('Прежде чем зарегистрироваться, прочитайте наши %sПравила%s', "<a href='".W_ABSPATH."tos'>", "</a>.");
			?>
			</p>
			<form action="<?=W_ABSPATH?>registration" method="POST" enctype="multipart/form-data">
				<div class="wth_tdash mt20">
					<table>
						<tr>
							<td class="st_tb"><span>E-mail<sup>*</sup>:</span></td>
							<td><input type="text" class="reg_txt" name="email" value="<?=$objUser->email?>"/></td>
						</tr>
						<tr>
							<td class="st_tb"><span><?=/*/ Логин*/ _("Login")?><sup>*</sup>:</span></td>
							<td><input type="text" class="reg_txt" name="login" value="<?=$objUser->login?>" /></td>
						</tr>
						<tr>
							<td class="st_tb"><span><?=/*/ Пароль*/ _("Password")?><sup>*</sup>:</span></td>
							<td><input type="password" class="reg_txt" name="pass1" value=""/></td>
						</tr>
						<tr>
							<td class="st_tb"><span><?=/*/ Повторите пароль*/ _("Repeat password")?><sup>*</sup>:</span></td>
							<td><input type="password" class="reg_txt" name="pass2" /></td>
						</tr>
					</table>
				</div><!-- .wth_tdash -->
				
				<div class="wth_tdash mt20">
					<table>
						<tr>
							<td class="st_tb"><span><?=/*/ Имя*/ _("First name")?><sup>*</sup>:</span></td>
							<td><input type="text" class="reg_txt" name="firstName" value="<?=$objUser->firstName?>"/></td>
						</tr>
						<tr>
							<td class="st_tb"><span><?=/*/ Фамилия*/ _("Last name")?><sup>*</sup>:</span></td>
							<td><input type="text" class="reg_txt" name="lastName" value="<?=$objUser->lastName?>"/></td>
						</tr>
<!--						<tr>
							<td class="st_tb"><span>Отчество:</span></td>
							<td><input type="text" class="reg_txt" name="" /></td>
						</tr>-->
						<tr>
							<td class="st_tb"><span><?=/*/ Дата рождения*/ _("Birthday")?>:</span></td>
							<td>
								<input style="width:35px;" type="text" placeholder="ДД" maxlength="2" name="birthDayDay" value="<?=$objUser->birthDay_day?>">
								<input style="width:35px;" type="text" placeholder="ММ" maxlength="2" name="birthDayMonth" value="<?=$objUser->birthDay_month?>">
								<select name="birthDayYear">
									<?=Service_Date::getOptionsForYearSelect(1950, $objUser->birthDay_year);?>
								</select>
							</td>
						</tr>
						<tr>
							<td class="st_tb"><span><?=/*/ Страна*/ _("Country")?>:</span></td>
							<td>
								<select name="country" id="country_select" style="width:150px;" onchange="regChangeCountry(this)">
									<?=Service_Country::getOptionsForCountrySelect(Service_Country::getAllCountry(), $objUser->country)?>
								</select>
							</td>
						</tr>
						<tr>
							<td class="st_tb"><span><?=/*/ Город*/ _("City")?>:</span></td>
							<td>
								<select name="city" id="city_select" style="width:150px;">
									<?=Service_Country::getOptionsForCitySelect(Service_Country::getAllCity($objUser->country), $objUser->city)?>
								</select>
							</td>
						</tr>												
						<tr>
							<td class="st_tb"><span><?=/*/ Пол*/ _("Sex")?>:</span></td>
							<td>
								<select name="sex" onchange="regChangeSex(this);">
									<option value="male"><?=/*/ мужской*/_("male")?></option>
									<option value="female"><?=/*/ женский*/_("female")?></option>
								</select>
							</td>
						</tr>
						<tr>
							<td class="st_tb"><span><?=/*/ Телефон*/ _("Phone")?>:</span></td>
							<td><input type="text" class="reg_txt" name="phone" value="<?=$objUser->phone?>" /></td>
						</tr>	
						<tr>
							<td class="st_tb"><span>
							<?=/// Семейное положение
							_("Relationship status")?>:</span></td>
							<td>
								<select name="relationshipStatus_male" id="relationshipStatus_male">
									<option value="None Selected" <?=($objUser->relationshipStatus == "None Selected" ? 'selected="selected"' : '')?>>
										<?=/// не выбрано
										pgettext("relationShipStatus_male", "None Selected")?>
									</option>
									<option value="Single" <?=($objUser->relationshipStatus == "Single" ? 'selected="selected"' : '')?>>
										<?=/// не женат
										pgettext("relationShipStatus_male", "Single")?>
									</option>
									<option value="In a relationship" <?=($objUser->relationshipStatus == "In a relationship" ? 'selected="selected"' : '')?>>
										<?=/// есть подруга
										pgettext("relationShipStatus_male", "In a relationship")?>
									</option>
									<option value="Engaged" <?=($objUser->relationshipStatus == "Engaged" ? 'selected="selected"' : '')?>>
										<?=/// помолвлен
										pgettext("relationShipStatus_male", "Engaged")?>
									</option>
									<option value="Married" <?=($objUser->relationshipStatus == "Married" ? 'selected="selected"' : '')?>>
										<?=/// женат
										pgettext("relationShipStatus_male", "Married")?>
									</option>
									<option value="In love" <?=($objUser->relationshipStatus == "In love" ? 'selected="selected"' : '')?>>
										<?=/// влюблен
										pgettext("relationShipStatus_male", "In love")?>
									</option>
									<option value="It's complicated" <?=($objUser->relationshipStatus == "It's complicated" ? 'selected="selected"' : '')?>>
										<?=/// все сложно
										pgettext("relationShipStatus_male", "It's complicated")?>
									</option>
									<option value="Actively searching" <?=($objUser->relationshipStatus == "Actively searching" ? 'selected="selected"' : '')?>>
										<?=/// в активном поиске
										pgettext("relationShipStatus_male", "Actively searching")?>
									</option>
								</select>
								<select name="relationshipStatus_female" id="relationshipStatus_female" style="display:none;">
									<option value="None Selected" <?=($objUser->relationshipStatus == "None Selected" ? 'selected="selected"' : '')?>>
										<?=/// не выбрано
										pgettext("relationShipStatus_female", "None Selected")?>
									</option>
									<option value="Single" <?=($objUser->relationshipStatus == "Single" ? 'selected="selected"' : '')?>>
										<?=/// не замужем
										pgettext("relationShipStatus_female", "Single")?>
									</option>
									<option value="In a relationship" <?=($objUser->relationshipStatus == "In a relationship" ? 'selected="selected"' : '')?>>
										<?=/// есть друг
										pgettext("relationShipStatus_female", "In a relationship")?>
									</option>
									<option value="Engaged" <?=($objUser->relationshipStatus == "Engaged" ? 'selected="selected"' : '')?>>
										<?=/// помолвлена
										pgettext("relationShipStatus_female", "Engaged")?>
									</option>
									<option value="Married" <?=($objUser->relationshipStatus == "Married" ? 'selected="selected"' : '')?>>
										<?=/// замужем
										pgettext("relationShipStatus_female", "Married")?>
									</option>
									<option value="In love" <?=($objUser->relationshipStatus == "In love" ? 'selected="selected"' : '')?>>
										<?=/// влюблена
										pgettext("relationShipStatus_female", "In love")?>
									</option>
									<option value="It's complicated" <?=($objUser->relationshipStatus == "It's complicated" ? 'selected="selected"' : '')?>>
										<?=/// все сложно
										pgettext("relationShipStatus_female", "It's complicated")?>
									</option>
									<option value="Actively searching" <?=($objUser->relationshipStatus == "Actively searching" ? 'selected="selected"' : '')?>>
										<?=/// в активном поиске
										pgettext("relationShipStatus_female", "Actively searching")?>
									</option>
								</select>							
							</td>
						</tr>								
						<tr>
							<td class="st_tb"><span><?=/*/ Фотография*/ _("Photo")?>:</span></td>
							<td>
								<input type="file" class="upload_file" name="photo"/>
							</td>
						</tr>
					</table>
				</div><!-- .wth_tdash -->
				
				<div class="wth_tdash mt20">
					<table>
						<tr>
							<td class="st_tb"><span><?=/*/ Профессия*/ _("Profession")?>:</span></td>
							<td><input type="text" class="reg_txt" name="profession" value="<?=$objUser->profession?>"/></td>
						</tr>
						<tr>
							<td class="st_tb"><span><?=/*/ Опыт работы*/ _("Work experience")?>:</span></td>
							<td>
								<select name="professionExperience">
									<option value="1" <?=($objUser->professionExperience == 1 ? 'selected="selected"' : '')?>><?printf(ngettext("%d year", "%d years", 1), 1);?></option>
									<option value="2" <?=($objUser->professionExperience == 2 ? 'selected="selected"' : '')?>><?printf(ngettext("%d year", "%d years", 2), 2);?></option>
									<option value="3" <?=($objUser->professionExperience == 3 ? 'selected="selected"' : '')?>><?printf(ngettext("%d year", "%d years", 3), 3);?></option>
									<option value="4" <?=($objUser->professionExperience == 4 ? 'selected="selected"' : '')?>><?printf(ngettext("%d year", "%d years", 4), 4);?></option>
									<option value="5" <?=($objUser->professionExperience == 5 ? 'selected="selected"' : '')?>><?printf(ngettext("%d year", "%d years", 5), 5);?></option>
									<option value="6" <?=($objUser->professionExperience == 6 ? 'selected="selected"' : '')?>><?printf(ngettext("%d year", "%d years", 6), 6);?></option>
									<option value="7" <?=($objUser->professionExperience == 7 ? 'selected="selected"' : '')?>><?printf(ngettext("%d year", "%d years", 7), 7);?></option>
									<option value="8" <?=($objUser->professionExperience == 8 ? 'selected="selected"' : '')?>><?printf(ngettext("%d year", "%d years", 8), 8);?></option>
									<option value="9" <?=($objUser->professionExperience == 9 ? 'selected="selected"' : '')?>><?printf(ngettext("%d year", "%d years", 9), 9);?></option>
									<option value="10" <?=($objUser->professionExperience == 10 ? 'selected="selected"' : '')?>><?printf(ngettext("%d year", "%d years", 10), 10);?></option>
								</select>
							</td>
						</tr>
					</table>
				</div><!-- .wth_tdash -->
				
				<div class="wth_tdash mt20">
					<table>
						<tr>
							<td class="st_tb"><span>Капча:</span></td>
							<td><p><img src="<?=W_ABSPATH?>include/captcha/?<?=session_name()?>=<?=session_id()?>"></p></td>
						</tr>
						<tr>
							<td class="st_tb"><span>Введите текст с картинки<sup>*</sup>:</span></td>
							<td><input type="text" class="reg_txt" name="regKcapthca" size="16" value="<?//=$objUser->regKcapthca?>"/></td>
						</tr>
					</table>
				</div><!-- .wth_tdash -->				
				<div class="wth_tdash mt20">
					<table>
						<tr>
							<td class="st_tb">&nbsp;</td>
							<td>
								<input type="checkbox" name="regConfirmTerms" <?=($objUser->regConfirmTerms == 1 ? 'checked="checked"' : "")?>/>
								<span> Я согласен с <a href='<?=W_ABSPATH?>tos'>Условиями и правилами</a></span>
							</td>
						</tr>
						<tr>
							<td class="st_tb">&nbsp;</td>
							<td>
								<input type="submit" class="confirm" name="registration" value="Зарегистрироваться" />
							</td>
						</tr>
					</table>
				</div><!-- .wth_tdash -->
			</form>
			<p><i>Примечание: заполнение полей, отмеченных звездочкой, является обязательным.</i></p>
			<p><i>Логин - это имя на сайте. Логин должен состоять из букв латинского алфавита и цифр.</p></i>
			<p><i>Регистрируясь, Вы автоматически подписываете 
			<a href="<?=W_ABSPATH?>tos/">Соглашение</a>
			<br/>
			После подтверждения e-mail Вы сможете размещать объявления, добавлять компании, прикреплять фото, 
			видео и документы к объявлениям.</i></p>			
		<?
	}
	
	/**
	 * Метод выводит кусок формы для сокращенной регистрации пользователя
	 * можно вставлять в любую форму где требуется регистрация
	 *
	 */
	public static function showUserShortRegForm(){
		$objUser = User_User::instance();
		
		?>
		<div class="wth_tdash mt20">
			<table>
				<tr>
					<td class="st_tb"><span><?=/*/ эл почта*/ _("E-mail")?><sup>*</sup>:</span></td>
					<td>
						<input type="text" class="reg_txt" name="email" size="50" value="<?=$objUser->email?>">
					</td>
				</tr>
				
				<tr>
					<td class="st_tb"><span><?=/*/ логин*/ _("Login")?><sup>*</sup>:</span></td>
					<td><input type="text" class="reg_txt" name="login" size="50" value="<?=$objUser->login?>"></td>
				</tr>			
				
				<tr>
					<td class="st_tb"><span>Капча:</span></td>
					<td><p><img src="<?=W_ABSPATH?>include/captcha/?<?=session_name()?>=<?=session_id()?>"></p></td>
				</tr>
				<tr>
					<td class="st_tb"><span>Введите текст с картинки<sup>*</sup>:</span></td>
					<td><input type="text" class="reg_txt" name="regKcapthca" size="16" value="<?//=$objUser->regKcapthca?>"/></td>
				</tr>
			</table>
		</div><!-- .wth_tdash -->		

		<?
	}
	
	public static function viewUserRightColumnProfile($objUser){
		?>
		<div class="profile_lf">
			<div class="bt_dash">
				<div class="center">
				
<!--					<a href="#"><img width="105" height="105" class="ava_preview" title="" alt="" src="images/temp/avatar.jpg"></a><br>-->
					<div class="avatar left">
						<?=$objUser->getUserAvatar(240, true)?>
						<br>
						<a href="<?=W_ABSPATH?>edit_avatar">Изменить аватар</a>
					</div>
					<a class="user_pro_name" href="<?=W_ABSPATH?>profile/<?=$objUser->getIdUser()?>"><b><?=$objUser->arrUserInfo["first_name"]." ".$objUser->arrUserInfo["last_name"]?></b></a>
				</div> <!-- .center-->
				<p><span class="sp_grey pr10">Пол:</span> <?=$objUser->arrUserInfo["sex"] == "male" ? _("male") : _("female")?></p>
				<p><span class="sp_grey pr10">Возраст:</span> <?=Service_Date::getAge($objUser->arrUserInfo["birthDay"])?></p>
				<p><span class="sp_grey pr10">Профессия:</span> <?=$objUser->arrUserInfo["profession"]?></p>
				<p><span class="sp_grey pr10">Опыт работы:</span> <?$year=intval($objUser->arrUserInfo["profession_experience"]{0}.$objUser->arrUserInfo["profession_experience"]{1}.$objUser->arrUserInfo["profession_experience"]{2}.$objUser->arrUserInfo["profession_experience"]{3}); printf(ngettext("%d year", "%d years", $year), $year)?></p>
			</div><!-- .bt_dash -->
		</div>
		<?
	}

}

?>